<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="s_quote" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="gotoPage('/psi/supplychainmana/InventoryList?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 盘存记录 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="仓库" prop="">
              {{s_quote.firm_id}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存方式" prop="">
              {{s_quote.set_way}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="盘存开始时间" prop="">
              {{getDateTimeString(s_quote,'take_date')}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <div class="form-unit">
        <span class="mvc-title-left"> 盘存内容 </span>
      </div>
      <el-table :data="s_product">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="popInventoryUpDet('&CMIDnote_id='+scope.row.note_id+'')">修改</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="产品条形码" prop="product_barcode">
        </el-table-column>
        <el-table-column label="产品名称" prop="product_name">
        </el-table-column>
        <el-table-column label="规格型号" prop="product_model">
        </el-table-column>
        <el-table-column label="产品区域" prop="">
        </el-table-column>
        <el-table-column label="累积数量" prop="product_num">
        </el-table-column>
        <el-table-column label="实际盘存数" prop="take_num">
        </el-table-column>
        <el-table-column label="差异原因" prop="take_diff">
        </el-table-column>
        <el-table-column label="差异处理" prop="take_process">
        </el-table-column>
        <el-table-column label="盘存结论" prop="take_verdict">
        </el-table-column>
      </el-table>
    </el-form>
    <el-dialog :visible.sync="InventoryUpDetVisible" append-to-body>
      <InventoryUpDet v-if="InventoryUpDetVisible" ref="InventoryUpDet" :popparams="popparams"> </InventoryUpDet>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import InventoryUpDet from "@/views/psi/supplychainmana/InventoryUpDet";
  export default {
    name: 'InventoryDet2',
    components: {
      InventoryUpDet,
    },
    props: ['popparams'],
    data() {
      return {
        InventoryUpDetVisible: false,
        InventoryUpDetValue: null,
        InventoryUpDetDesc: null,
        vueparams: this.getVUEParams(""),
        s_quote: {
          firm_id: null,
          set_way: null,
          take_date: null,
        },
        s_product: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/main/InventoryAction/inventoryDet2?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      popInventoryUpDet(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.InventoryUpDetVisible = !this.InventoryUpDetVisible;
      },
    },
  }
</script>
